package com.itheima.web.controller;

import com.itheima.web.domain.Admin;
import com.itheima.web.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 阿鹏
 * @date 2021/3/2 10:33
 */
@RestController
@RequestMapping("admin")
public class AdminController {

    @Autowired
    private AdminService adminService;

    /**
     * 登录
     * @param admin 用户名和密码
     * @return
     */
    @PostMapping("login")
    public ResponseEntity login(@RequestBody Admin admin) {
        return adminService.login(admin);
    }
}
